package com.legsem.jhosync.face;

import com.legsem.jhosync.Context;

/**
 * Developers create implementations of this interface. This allows JRhosync to
 * invoke custom authentication logic for Clients attempting to connect.
 * 
 */
public interface Application {

    /**
     * Client is required to provide user and password in order to use the
     * system. This can be used in your own code to authenticate against the
     * backend system if needed.
     * 
     * @param username the user ID provided on the client side
     * @param password the password provided on the client side
     * @param context session and configuration parameters
     * @return true if user is authorized to access the backend system
     */
    boolean authenticate(String username, String password, Context context);

}
